class Main extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            canchou: !1,
            type: -1, //1谢谢参与 2周边 3腾讯 4酒
            showresult: !1,
            showinfomodal: !1,
            piece: {
                one: '',
                two: "",
                three: '',
                four: ''
            }
        };
    }










    componentDidMount() {
        if (Constant.SWITCH_VCONSOLE) {
            new VConsole();
        }

        拉黑('42.249.23.12');
       


    }


    chou() {



        let { canchou } = this.state
        console.log(canchou, 'canchou');

        //this.setState({type:1})

        if (canchou) {
            this.setState({ showresult: !0 })
        } else {
            alert('您还未集齐碎片')
        }

    }
    inputchange(type, e) {
        this.setState({ [type]: e.target.value })
    }
    submit() {
        alert('提交成功')
        window.location.href = './main.html'
    }



    render() {
        let { myphone, addr, phone, name, type, showresult, showinfomodal } = this.state

        return (
            <div className="app">
                <div className="myinfo">您好,{myphone}</div>
                <img className="bg" src="./src/detail_bg.png" alt="" />
                <div style={{ display: showresult || showinfomodal ? 'none' : '' }} className="wrap">
                    <p className="word1">“恭喜您拼出团”缘圆！获得一次抽奖机会！</p>
                    <div className="zhuanpandiv">
                        <img src="./src/zhizhen.png" alt="" className="zhizhen" />
                        <img src="./src/zhuanpandi.png" alt="" className="di" />
                        <img onClick={this.chou.bind(this)} className={'zhuanpan z' + type} src="./src/zhuanpan.png" alt="" />


                    </div>
                    <p className="word2">规则说明：每个微信ID每天仅可合成抽奖一次</p>
                    <div className="btns">
                        <img onClick={this.chou.bind(this)} className="back" src="./src/choubtn.png" alt="" />
                        <img onClick={() => {
                            window.location.href = './main.html'
                        }} className="back" src="./src/back_btn.png" alt="" />
                    </div>

                </div>
                <div style={{ display: showresult ? '' : 'none' }} className="resultmodal">
                    <p className="word1">恭喜您获得腾讯季卡</p>
                    <p className="word2">规则说明：每个微信ID每天仅可合成抽奖一次
                    </p>
                    <div className="btns">

                        <img onClick={() => {
                            console.log('rrrr');
                            this.setState({ showresult: !1, showinfomodal: !0 })
                        }} className="back" src="./src/denglubtn.png" alt="" />
                    </div>
                    <img onClick={() => {
                        window.location.href = './main.html'
                    }} src="./src/close.png" className="close" alt="" />

                </div>

                <div style={{ display: showinfomodal ? '' : 'none' }} className="infomodal">
                    <p className="word1">恭喜您获得团缘奖励</p>
                    <p className="word1">请您如实填写以下信息</p>
                    <div className="infodiv">
                        <div>
                            <p>*姓名</p>
                            <input type="text" onChange={this.inputchange.bind(this, "name")} value={name} />
                        </div>
                        <div>
                            <p>*电话</p>
                            <input type="text" maxLength={11} onChange={this.inputchange.bind(this, "phone")} value={phone} />
                        </div>
                        <div>
                            <p>*地址</p>
                            <input type="text" maxLength={11} onChange={this.inputchange.bind(this, "addr")} value={addr} />
                        </div>
                    </div>
                    <div className="btns">

                        <img onClick={this.submit.bind(this)} className="back" src="./src/tijiaobtn.png" alt="" />
                    </div>
                    <img onClick={() => {
                        window.location.href = './main.html'
                    }} src="./src/close.png" className="close" alt="" />

                </div>



            </div>


        )
    }
}

ReactDOM.render(
    <div>
        {/* <TopLine /> */}
        <div id='body'>

            <Main />
        </div>
    </div>
    // <Barrage />
    , $('.container')[0]
)